﻿<%@ WebHandler Language="C#" Class="GerarRelatorio" %>

using System;
using System.Web;
using System.IO;
using System.Collections.Generic;
using HtmlAgilityPack;
using iTextSharp.text;
using iTextSharp.text.pdf;
using iTextSharp.text.html.simpleparser;
public class GerarRelatorio : IHttpHandler
{
    public void ProcessRequest(HttpContext context)
    {
        HtmlWeb htmlweb = new HtmlWeb();
        HtmlDocument htmlDoc = htmlweb.Load(String.Format("http://localhost:1916/servicegerenciador/relatorios/rel_{0}.aspx", context.Request.QueryString["RelType"]));
        context.Response.Write(htmlDoc.DocumentNode.InnerHtml);
        context.Response.End();
    }

    public bool IsReusable
    {
        get
        {
            return false;
        }
    }
}